package com.hdbandit.multi_tenant.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.hdbandit.multi_tenant.interceptor.MultitenancyInterceptor;

/**
 * springmvc的相关配置
 * @author Administrator
 *
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

	/**
	 * 将我们自定义的多租户拦截器加入springmvc
	 */
     @Override
     public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(new MultitenancyInterceptor());
     }
}
